<template>
  <el-card style="width: 100%;">
    <div slot="header">奔跑的熊</div>
    <div class="bear-box">
      <div class="bear"></div>
    </div>
  </el-card>
</template>

<script>
export default {}
</script>

<style lang="less" scoped>
@keyframes hill {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -3840px 0;
  }
}

.bear-box {
  position: relative;
  height: 336px;
  background: url(../../../../assets/bg1.png) repeat-x;
  background-size: auto 100%;
  animation: hill 100s linear 0.8s infinite normal none;
}

@keyframes bear {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -1600px 0;
  }
}

@keyframes move {
  from {
    left: 0;
  }

  to {
    left: 50%;
    transform: translateX(-50%);
  }
}

.bear {
  position: absolute;
  top: 236px;
  width: 200px;
  height: 100px;
  background: url(../../../../assets/bear.png) no-repeat;
  animation: bear 1s steps(8) infinite, move 3s forwards;
}
</style>
